<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="raw_data.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:key name="departments" match="row" use="@department_shortdesc" />

<xsl:template match="rawdata">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Departments</title>
	<link href="css.css" rel="stylesheet" type="text/css" />

	<script type="text/javascript">
		var choice, preChoice;
		function go() {
			if (null != preChoice){
				showCourses(preChoice);
			}
			choice = document.getElementById("menu").value;
			showCourses(choice);
			preChoice = choice;
		}
		function showCourses(ga){
			var elem, vis;
			elem = document.getElementById(ga);
			vis = elem.style;
			if (vis.display=='block'){
  				vis.display = 'none';
			}
			else{
				vis.display = 'block';
			}
		}
	</script>
</head>

<body>
	<div id="content">
		
		<form>
			<div class="dropDownBlock">
				<b>Department:</b>&nbsp;
				<select id="menu" onchange="go()">
					<option value="none">--Select a Department--</option>
  					<xsl:for-each select="row[count(. | key('departments', @department_shortdesc)[1]) = 1]">
						<xsl:sort select="@department_shortdesc" />
  						<option value="{@department_shortdesc}"><xsl:value-of select="@department_longdesc" /></option>
    					</xsl:for-each>
				</select>
			</div>
		</form>
		
		<xsl:for-each select="row[count(. | key('departments', @department_shortdesc)[1]) = 1]">
			<xsl:sort select="@department_shortdesc" />
			<div id="{@department_shortdesc}" class="displayNone">                                                          
      			<xsl:for-each select="key('departments', @department_shortdesc)">      
					<xsl:sort select="@course_num" />   
					<div class="courseBlock">   
						<table>
							<tr>
								<td>              
            							<b>Course Number:</b>&nbsp;
								</td>
								<td>
									<xsl:value-of select="@department_shortdesc" />&nbsp;<xsl:value-of select="@course_num" />
								</td>
							</tr>
							<tr>
								<td>
									<b>Course Name:</b>&nbsp;
								</td>
								<td>
									<xsl:value-of select="@course_desc" />
								</td>
							</tr>
            					<tr>
								<td>
            							<b>Credits:</b>&nbsp;
								</td>
								<td>
									<xsl:value-of select="@course_credits" />
								</td>
							</tr>
							<tr>
								<td>
            							<b>Goal Area:</b>&nbsp;
								</td>
								<td>
									<xsl:value-of select="@goalarea_goalnum" />&nbsp;(<xsl:value-of select="@goalarea_desc" />)
								</td>
							</tr>
						</table>
					</div>
				</xsl:for-each><br />
        		</div>
		</xsl:for-each>
    		<div id="none" class="displayNone"></div>
		</div>
</body>
</html>

</xsl:template>
</xsl:stylesheet>